<%@ page language="java" contentType="text/html; charset=EUC-KR" pageEncoding="EUC-KR"%>
<%@ page import="performReservation.SMMDBBean"%>
<%@ page import="java.sql.*"%>
<%@ page import="java.util.Vector"%>
<%!
	Vector<String[]> vec = new Vector<String[]>();
	String per_num = null;
	String cin_num = null;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Sales</title>
</head>
<center><h2>Sales :</h2></center>
<body>
	<%
		per_num = request.getParameter("per");
		cin_num = request.getParameter("num");
		if(!per_num.equals("")&&!cin_num.equals("")&&per_num!=null&&cin_num!=null){
			SMMDBBean pProcess = SMMDBBean.getInstance();
			vec = pProcess.getSalesDetail(cin_num,per_num);
			if(vec!=null){
				%>
					<TABLE border ="3" align="center">
							<TR>
								<TH>Performance name</TH>
								<TH>Cinema name</TH>
								<TH>Time</TH>
								<TH>Price</TH>
								<TH>Remain</TH>
							</TR>
				<%
				for(int i = 0; i < vec.size(); i++){
					String[] sale = new String[8];
					sale = vec.get(i);
					%>
					<TR>
						<TD><a href="performDetail.jsp?num=<%=sale[2] %>"><%=sale[3] %></a></TD>
						<TD><a href="cinemaDetail.jsp?num=<%=sale[0] %>"><%=sale[1] %></a></TD>
						<TD><%=sale[5] %></TD>
						<TD><%=sale[6] %></TD>
						<TD><%=sale[7] %></TD>
						<TD><a href="bookSale.jsp?num=<%=sale[4] %>">Book it</a></TD>
					</TR>
					<%
				}
				%>
				</TABLE>
				<%
			}else{
				out.println("No such sales");
			}
		}
	%>
</body>
</html>